package com.huawei.appgallery.search.ui.widget;

import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import o.ContentManager;
import o.epv;

public class MaxWidthLinearLayout extends LinearLayout {
    private boolean ˏ = false;
    private int ॱ;

    public MaxWidthLinearLayout(Context context) {
        super(context);
    }

    public MaxWidthLinearLayout(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public MaxWidthLinearLayout(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
    }

    protected void onMeasure(int i, int i2) {
        if (this.ˏ) {
            super.onMeasure(MeasureSpec.makeMeasureSpec(this.ॱ, Integer.MIN_VALUE), i2);
            return;
        }
        Resources resources = ContentManager.getInstant().getContext().getResources();
        if (resources != null && 2 == resources.getConfiguration().orientation) {
            this.ॱ = epv.ʽ(getContext());
            i = MeasureSpec.makeMeasureSpec(this.ॱ, 1073741824);
        }
        super.onMeasure(i, i2);
    }

    public void setMaxWidth(int i, boolean z) {
        this.ॱ = i;
        this.ˏ = z;
        invalidate();
    }
}
